package
{
import com.milkmangames.extensions.OurExtension;

import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.Event;
import flash.text.TextField;
import flash.text.TextFormat;
	
/** OurExtensionExample */
public class OurExtensionExample extends Sprite
{
	//
	// Instance Variables
	//
	
	/** Text Label */
	private var label:TextField;
	
	//
	// Public Methods
	//
	
	/** Create New OurExtensionExample */
	public function OurExtensionExample()
	{
		super();
			
		// support autoOrients
		stage.align = StageAlign.TOP_LEFT;
		stage.scaleMode = StageScaleMode.NO_SCALE;
		
		this.label=new TextField();
		this.label.defaultTextFormat=new TextFormat("Arial",42);
		this.label.width=stage.stageWidth;
		
		this.addChild(label);
		log("Starting extension...");
		
		var extension:OurExtension=new OurExtension();
		extension.addEventListener(Event.COMPLETE, onComplete);
		
		log("Showing message...");
		extension.showMessageBox("Hello extension!");	
		log("Message shown.");
	}
	
	//
	// Events
	//
	
	/** On Message Complete */
	private function onComplete(e:Event):void
	{
		log("Message Complete Event!");
	}
	
	//
	// Implementation
	//
	
	/** Log Message */
	private function log(msg:String):void
	{
		trace(msg);
		this.label.text=msg;
	}
}
}